package com.learn.project2.controller.wx.aftersale;

import com.learn.project2.bean.MarketAftersale;
import com.learn.project2.model.bo.wx.aftersale.AftersaleListBO2;
import com.learn.project2.model.bo.wx.aftersale.AftersaleSubmitBO2;
import com.learn.project2.model.vo.wx.aftersale.AftersaleDetailVO2;
import com.learn.project2.model.vo.wx.aftersale.AftersaleVO2;
import com.learn.project2.service.admin.aftersale.AftersaleService;
import com.learn.project2.service.wx.aftersale.AftersaleService2;
import com.learn.project2.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * \* Author: Valley
 * \* Date: 2022/1/12
 * \* Time: 15:43
 * \* Description:
 */
@RestController
@RequestMapping("wx/aftersale")
public class AftersaleController2 {

    @Autowired
    AftersaleService2 aftersaleService2;

    @RequestMapping("submit")
    public Result submit(@RequestBody AftersaleSubmitBO2 submitBO2){
        Integer code = aftersaleService2.submit(submitBO2);
        return Result.ok();
    }

    @RequestMapping("list")
    public Result list(AftersaleListBO2 aftersaleListBO2){
        AftersaleVO2 aftersaleVO2 = aftersaleService2.aftersaleList(aftersaleListBO2);
        return Result.ok(aftersaleVO2);
    }

    @RequestMapping("detail")
    public Result detail(Integer orderId){
        AftersaleDetailVO2 detailVO2 = aftersaleService2.aftersaleDetail(orderId);
        return Result.ok(detailVO2,"成功");
    }
}
